package com.airlines.crewassignment.service.linkline.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.airlines.base.service.base.impl.BaseServiceImpl;
import com.airlines.crewassignment.dao.linkline.FlightCrewLinkLineNoMapper;
import com.airlines.crewassignment.entity.linkline.FlightCrewLinkLineNo;
import com.airlines.crewassignment.service.linkline.FlightCrewLinkLineNoService;

/**
 * @author xxxx
 * @date 2018年6月20日 
 * @description
 */
@Service
public class FlightCrewLinkLineNoServiceImpl extends BaseServiceImpl<FlightCrewLinkLineNo, Integer> implements FlightCrewLinkLineNoService{
	@Autowired
	private FlightCrewLinkLineNoMapper flightCrewLinkLineNoMapper;
	@Autowired
	@Override
	public void setBaseMapper() {
		super.setBaseMapper(flightCrewLinkLineNoMapper);
		
	}
	@Override
	public FlightCrewLinkLineNo getFlightCrewLinkLineNo(int flightId, String dutyCode) {
		FlightCrewLinkLineNo flightCrewLinkLineNoQuery = new FlightCrewLinkLineNo();
		flightCrewLinkLineNoQuery.setFlightId(flightId);
		flightCrewLinkLineNoQuery.setModuleFlag(dutyCode);
		List<FlightCrewLinkLineNo> list = this.listData(flightCrewLinkLineNoQuery);
		if(list !=null && list.size() ==1){
			return list.get(0);
		}else{
			return null;
		}
		
	}

}
